package com.chuyu.cy.controller;

import com.chuyu.cy.contants.Result;
import com.chuyu.cy.entity.vo.NeedsKindVo;
import com.chuyu.cy.service.TemporaryNeedsKindsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: 周小白
 * @date: 2024-03-15 18:11
 **/
@RestController
@RequestMapping("/kind")
@Tag(name = "需求种类")
public class NeedsKindController {

    @Resource
    private TemporaryNeedsKindsService temporaryNeedsKindsService;



    /**
     * 获取需求种类列表
     * @return 需求种类列表
     */
    @GetMapping("/list")
    @Operation(summary = "获取需求种类列表")
    public Result<List<NeedsKindVo>> getNeedsKindList() {
        Result<List<NeedsKindVo>> result = new Result<>();

        List<NeedsKindVo> needsKindList = temporaryNeedsKindsService.getNeedsKindList();

        return result.success(needsKindList);
    }
}
